#include "ejcareerset.h"
#include <QGridLayout>
#include <QLabel>
#include <QWidget>
#include <QTextEdit>


EJCareerSet::EJCareerSet(QWidget *parent) : QMainWindow(parent)
{
    auto central = new QWidget(this);
    setCentralWidget(central);

    auto m_layout = new QGridLayout(central);

    m_career = new QListWidget();

    auto car = new QLabel(tr("职业列表"), this);
    car->setAlignment(Qt::AlignHCenter);

    m_layout->addWidget(car, 0, 0, 1, 1);

    m_layout->addWidget(m_career, 1, 0, 7, 1);

    auto sublayout = new QGridLayout();
    m_layout->addLayout(sublayout, 0, 1, 8, 6);

    m_layout->setColumnStretch(0, 1);
    m_layout->setColumnStretch(1, 6);

    m_layout->setRowStretch(0,1);
    m_layout->setRowStretch(1,30);

    m_layout->setSpacing(5);
    central->setLayout(m_layout);

    auto carLabel = new QLabel(tr("职业名称"), this);
    carLabel->setAlignment(Qt::AlignRight);
    sublayout->addWidget(carLabel, 0, 0, 1, 1);
    sublayout->addWidget(m_curCar = new QComboBox(this), 0, 1, 1, 1);

    auto preLabel = new QLabel(tr("前置职业"), this);
    preLabel->setAlignment(Qt::AlignRight);
    sublayout->addWidget(preLabel, 1, 0, 1, 1);
    sublayout->addWidget(m_preCar = new QComboBox(this), 1, 1, 1, 1);

    auto levelLabel = new QLabel(tr("等级限制"), this);
    levelLabel->setAlignment(Qt::AlignRight);
    sublayout->addWidget(levelLabel, 1, 2, 1, 1);
    sublayout->addWidget(m_levelCla = new QComboBox(this), 1, 3, 1, 1);

    sublayout->addWidget(new QLabel("", this), 1, 4, 7, 4);

    auto claLabel = new QLabel(tr("种族限制"), this);
    claLabel->setAlignment(Qt::AlignRight);
    sublayout->addWidget(claLabel, 2, 0, 1, 1);
    sublayout->addWidget(m_raceCla = new QComboBox(this), 2, 1, 1, 1);

    auto sexLabel = new QLabel(tr("性别限制"), this);
    sexLabel->setAlignment(Qt::AlignRight);
    sublayout->addWidget(sexLabel, 2, 2, 1, 1);
    sublayout->addWidget(m_sexCla = new QComboBox(this), 2, 3, 1, 1);

    sublayout->addWidget(new QLabel("", this), 3, 0, 10, 4);

    auto decLabel = new QLabel(tr("职业描述"), this);
    decLabel->setAlignment(Qt::AlignRight);
    sublayout->addWidget(decLabel, 12, 0, 1, 1);
    sublayout->addWidget(new QTextEdit(this),13, 1, 4, 3);

    sublayout->addWidget(new QLabel("", this), 17, 0, 3, 4);

    central->setStyleSheet("QLabel{color:#888888;}");
}
